package com.easyUploader.util;

import cn.hutool.extra.spring.SpringUtil;
import com.email.CommonEmailService;

import static com.easyUploader.util.CodeUtil.CODE_EXPIRE_TIME;


/**
 * @author 大忽悠
 * @create 2022/11/16 10:55
 */
public class EamilUtil {
    private static final String SUBJECT="EasyUploader轻量级云存储服务";
    private static final String PREFIX="验证码为: ";
    private static final String SUFFIX="(验证码将在"+CODE_EXPIRE_TIME+"分钟后过期)";

    public static void sendCode(String eamil,String code){
        CommonEmailService commonEmailService = SpringUtil.getBean(CommonEmailService.class);
        commonEmailService.sendTextMailMessage(SUBJECT,PREFIX+code+SUFFIX,eamil);
    }
}
